﻿@model ASPMVC_first_app.ViewModels.MovieFormViewModel
@{
    ViewBag.Title = "Movie";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>@ViewBag.Action</h2>

@using (Html.BeginForm("Save", "Movies"))
{
    @Html.ValidationSummary(true, "Please enter information to red fields");
    <div class="form-group">
        @Html.LabelFor(m => m.Movie.Name)
        @Html.TextBoxFor(m => m.Movie.Name, new {@class= "form-control" })
        @Html.ValidationMessageFor(m => m.Movie.Name)
    </div>

    <div class="form-group">
        @Html.LabelFor(m => m.Movie.Description)
        @Html.TextBoxFor(m => m.Movie.Description, new { @class = "form-control" })
        @Html.ValidationMessageFor(m => m.Movie.Description)
    </div>
    <div class="form-group">
        @Html.LabelFor(m => m.Movie.GenreId)
        @Html.DropDownListFor(m => m.Movie.GenreId,
       new SelectList(Model.Genres, "Id", "Name"),
       "Select Movie",
       new { @class="form-control"})
        @Html.ValidationMessageFor(m => m.Movie.GenreId)
    </div>
    <div class="form-group">
        @Html.LabelFor(m => m.Movie.Received)
        @Html.TextBoxFor(m => m.Movie.Received, "{0:d, MMM yyyy}", new { @class = "form-control" })
        @Html.ValidationMessageFor(m => m.Movie.Received)
    </div>
    <div class="form-group">
        @Html.LabelFor(m => m.Movie.Count)
        @Html.TextBoxFor(m => m.Movie.Count, new { @class = "form-control" })
        @Html.ValidationMessageFor(m => m.Movie.Count)
    </div>
    @Html.HiddenFor(m => m.Movie.Id);
    <div>
        <button type = "submit" class="btn btn-primary">Save</button>
    </div>
       
}
@section scripts
{
    @Scripts.Render("~/bundles/jqueryval")
}
